package com.gykj.rtm.facade.admin;

import java.util.List;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;
import com.gykj.admin.common.entity.Role;
import com.gykj.admin.common.entity.RoleResources;

@FeignClient("gykj-admin-service")
public interface RoleFacade {
	 	@RequestMapping(value = "/roles/getAllRoleList")
	    public  PageInfo<Role> getAllRoleList(
	    		@RequestBody Role role,
	            @RequestParam(value="currentPage",required = false, defaultValue = "1") int currentPage,
	            @RequestParam(value="pageSize",required = false, defaultValue = "20") int pageSize,
	            @RequestParam(value="sortColumn",required = false, defaultValue = "1") int sortColumn,
	            @RequestParam(value="sortDesc",required = false, defaultValue = "1") int sortDesc
	                             );

	    @RequestMapping(value = "/roles/rolesWithSelected")
//	    public List<Role> rolesWithSelected(@RequestParam(value="uid",required=false) Integer uid);
	    public PageInfo<Role> rolesWithSelected(
	    		Role role,
	            @RequestParam(value="currentPage",required = false, defaultValue = "1") int currentPage,
	            @RequestParam(value="pageSize",required = false, defaultValue = "20") int pageSize,
	            @RequestParam(value="sortColumn",required = false, defaultValue = "1") int sortColumn,
	            @RequestParam(value="sortDesc",required = false, defaultValue = "1") int sortDesc
	           );
	    
	    @RequestMapping(value = "/roles/getRoleById")
	    public List<Role> getRoleById(@RequestParam(value = "uid",required = false) Integer uid);

	    //分配角色
	    @RequestMapping(value = "/roles/saveRoleResources")
	    public String saveRoleResources(@RequestBody RoleResources roleResources);

	    @RequestMapping(value = "/roles/add")
	    public String add(@RequestBody Role role);

	    @RequestMapping(value = "/roles/delete")
	    public String delete(@RequestParam(value="id",required=false) Integer id);
}
